﻿using System;
using System.Web.UI;
using tjb.Utility;

namespace tjb.WebTest {
    public partial class _Default : System.Web.UI.Page, ICallbackEventHandler {
        protected void Page_Load(object sender, EventArgs e) {
            //string cbReference = Page.ClientScript.GetCallbackEventReference(this, "text", "ReceiveServerData", "");   //获取一个对客户端函数的引用；调用该函数时，将启动一个对服务器端事件的客户端回调。
            //string callbackScript = "function dos(text){" + cbReference + ";}";                                        //注册客户端方法
            //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "dos", callbackScript, true);
            /****************************************************
            ConfigB2bEcom c = ConfigB2bEcom.Instance;

            Response.Write(c.ConfigFileFullName + "<BR>");
            GatherConfiguration g = GatherConfiguration.Instance;
            Response.Write(g.SaveType.ToString() + "<BR>");
            Response.Write(c.Save() + "<BR>");
            Response.Write(g.Save() + "<BR>");


            if (c.HasError)
                Response.Write(c.Exception.ToString() + "<BR>");
            if (g.HasError)
                Response.Write(g.Exception.ToString() + "<BR>");
            /****************************************************/

            SessionUtility.Set("a", 1);

            SessionUtility.Get<int>("a");

        }

        #region ICallbackEventHandler 成员

        string ev = "ev";

        public string GetCallbackResult() {
            return "GetCallbackResult |||=" + ev; ;
        }

        public void RaiseCallbackEvent(string eventArgument) {
            if (eventArgument == "1") {
                ev = "1";
            }
            if (eventArgument == "2")
                ev = "2";
            else
                ev = eventArgument;
        }

        #endregion
    }
}
